#!/bin/bash

rm install*.sh

git clone https://gitee.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://gitee.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

sed 's/plugins=(git)/plugins=(git zsh-syntax-highlighting zsh-autosuggestions)/g' .zshrc > .zshrc1
sed 's/ZSH_THEME="robbyrussell"/ZSH_THEME="ys"/g' .zshrc1 > .zshrc2
sed 's/# DISABLE_LS_COLORS="true"/DISABLE_UPDATE_PROMPT=true/g' .zshrc2 > .zshrc3
sed 's/source $ZSH\/oh-my-zsh.sh//g' .zshrc3 > .zshrc4
mv ~/.zshrc4 ~/.zshrc
rm ~/.zshrc1
rm ~/.zshrc2
rm ~/.zshrc3

echo "alias htop='TERM=xterm-color htop'" >> ~/.zshrc
echo "export LC_ALL=en_US.UTF-8" >> ~/.zshrc
echo "export LANG=en_US.UTF-8" >> ~/.zshrc
echo "DISABLE_UPDATE_PROMPT=true" >> ~/.zshrc
echo 'source $ZSH/oh-my-zsh.sh' >> ~/.zshrc

#source ~/.zshrc
echo "run 'source ~/.zshrc' to take effect of ZSH"